package com.gtqing.pay.enums;

import com.lly835.bestpay.enums.BestPayTypeEnum;
import javafx.print.PageLayout;
import lombok.Getter;

/**
 * @author gthang
 * @create 2022-04-05-23:17
 */
@Getter
public enum PayPlatformEnum {

//    1.支付宝2.微信
    ALIPAY(1),
    WX(2),
    ;

    Integer code;

    PayPlatformEnum(Integer code){
        this.code = code;
    }

    public static PayPlatformEnum getByBestPayTypeEnum(BestPayTypeEnum bestPayTypeEnum){


        for (PayPlatformEnum payPlatformEnum : PayPlatformEnum.values()) {
            if (bestPayTypeEnum.getPlatform().name().equals(payPlatformEnum.name())) {
                return payPlatformEnum;
            }
        }
        throw new RuntimeException("错误的支付平台："+bestPayTypeEnum.name());

    }




}
